package cn.iocoder.yudao.module.game.controller.app.gameList;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
import cn.iocoder.yudao.module.game.controller.admin.gameList.vo.GameListPageReqVO;
import cn.iocoder.yudao.module.game.controller.admin.gameList.vo.GameListRespVO;
import cn.iocoder.yudao.module.game.dal.dataobject.gameList.GameListDO;
import cn.iocoder.yudao.module.game.service.gameList.GameListService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;

@Tag(name = "管理后台 - 游戏列表")
@RestController
@RequestMapping("/game/list")
@Validated
public class AppGameListController {

    @Resource
    private GameListService listService;

    @GetMapping("/list")
    @Operation(summary = "获得游戏列表分页")
    public CommonResult<List<GameListRespVO>> getList(GameListPageReqVO pageReqVO) {
        List<GameListDO> result = listService.getList(pageReqVO);
        return success(BeanUtils.toBean(result, GameListRespVO.class));
    }

}